home *** CD-ROM | disk | FTP | other *** search
- ; Generate constant quadrature (IQ) sinewave (1.81 kHz) on left and right channels
-
- nolist
- include 'leonid'
- list
-
-
- buflen equ 32
- f equ 500
- fs equ 8000
-
- org p:user_code
-
- move #buffer+2,r7
- move #buflen*4-1,m7
-
- move #buffer,r2
- move #4-1,n2
- move #buflen*4-1,m2
-
- ctrlcd 1,r2,buflen,LINEI,0.0,0.0,LINEO|HEADP,0.0,0.0
- move (r2)+
- opencd fs/1000
-
- ; wait for one sample
- loop waitblk r2,buflen,1
-
- ; then generate the sinewave
- move #0.3,x1
-
- move x:<t1,x0
- mpy x0,x1,a x:<t2,y0
- sub y0,a x0,x:<t2
- move a,x:<t1
-
- ; and output the generated samples
- move x0,y:(r2)+
- move a,y:(r2)+n2
-
- jmp <loop
-
-
- org x:user_data
-
- t1 dc 0.9
- t2 dc 0.0
-
- buffer dsm buflen*4
-
-
- org y:user_data
-
- dsm buflen*4
-
-
- end
-